<html lang="en">
    <head>
        <script src="js/jquery-1.11.1.min.js"></script>
        <script type="text/javascript">
        //start your code here
        $(function() 
        {
                $('#lala').click(function()
                 {
                    var username = $('#username').val();
                    alert(username);
                 });
        });

        //end your code here
        </script>
    </head>
    <body>
        <input id="username" type="text" value="用户名"/>
        <input id="lala" type="button" name="btn" value="显示用户名"  />
    </body>
</html>